-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add base path support to TanStack Start #6279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: add base path support to TanStack Start #6279
Conversation
|
thanks for the contribution @andremonteiro95 how did you configure the i'm getting this error when trying your code:
|
|
My const config = defineConfig(() => {
const base = process.env.BASE_PATH || undefined
return {
base,
plugins: [
devtools(),
nitro({
baseURL: base,
preset: 'aws-lambda'
}),
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json']
}),
tanstackStart({
spa: {
enabled: true
}
}),
viteReact({
babel: {
plugins: ['babel-plugin-react-compiler']
}
})
]
}
})
export default configI generate the const BASE_PATH = isPermanentStage ? undefined : `/${$app.stage}`
export const web = new sst.aws.TanStackStart('Web', {
environment: {
...(BASE_PATH ? { BASE_PATH } : {})
},
// ...
}) |
|
thanks for sharing @andremonteiro95 the pr should be working but the router path doesn't seem to be equal to the
could you share a screenshot of your pr code working? any ideas why it doesn't work given the screenshot i attached |
|
From the screenshot alone, I'd guess you're missing the |
|
nice catch @andremonteiro95 now the only issue is that JS files are being requested from the base path but instead of the root
|
|
Can you send a reproducible example? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind @andremonteiro95
i had something wrong in my dev environment from testing multiple prs
great work!




This PR adds support for specifying a base path for TanStack Start apps, enabling deployment to specific paths.